<template>
  <WSchedule :planList="timePeriodList" :isFirstDayOfMondayOrSunday="1" :hasNumExpend="1" @handleDetail="handleDetail"
    @handleCardDetail="handleCardDetail" @changeWeek="changeWeek">
    <template v-slot:thing="{ row }">
      <span>{{ row.content }}</span>
      <span>{{ row.timePeriod }}</span>
    </template>
  </WSchedule>

  <WeekDayTodolist v-model="visible"></WeekDayTodolist>
</template>
<script>
import { SortUp } from "@element-plus/icons-vue";
import axios from "axios";
import WSchedule from "../../components/ScheduleCom/weekScheduleCom.vue";
import userCount from "../../stores/userCount";
import WeekDayTodolist from '@/views/Form/WeekDayTodolist.vue'

export default {
  data() {
    /**
     * 获取当天时间
     * @returns {string}
     */
    function getCurDay(num = 0) {
      var datetime = new Date();
      var year = datetime.getFullYear();
      var month =
        datetime.getMonth() + 1 < 10
          ? "0" + (datetime.getMonth() + 1)
          : datetime.getMonth() + 1;
      let day = datetime.getDate();
      if (day + num > 0) {
        day =
          day + num < 10
            ? "0" + (datetime.getDate() + num)
            : datetime.getDate() + num;
      } else {
        day =
          day - num < 10
            ? "0" + (datetime.getDate() - num)
            : datetime.getDate() - num;
      }
      return `${year}-${month}-${day}`;
    }
    return {
      store: userCount(),
      visible: false,
      timePeriodList: [
        {
          timePeriod: "00:00",
          schedule: [],
        },
        {
          timePeriod: "01:00",
          schedule: [],
        },
        {
          timePeriod: "02:00",
          schedule: [],
        },
        {
          timePeriod: "03:00",
          schedule: [],
        },
        {
          timePeriod: "04:00",
          schedule: [],
        },
        {
          timePeriod: "05:00",
          schedule: [],
        },
        {
          timePeriod: "06:00",
          schedule: [],
        },
        {
          timePeriod: "07:00",
          schedule: [],
        },
        {
          timePeriod: "08:00",
          schedule: [],
        },
        {
          timePeriod: "09:00",
          schedule: [],
        },
        {
          timePeriod: "10:00",
          schedule: [],
        },
        {
          timePeriod: "11:00",
          schedule: [],
        },
        {
          timePeriod: "12:00",
          schedule: [],
        },
        {
          timePeriod: "13:00",
          schedule: [],
        },
        {
          timePeriod: "14:00",
          schedule: [],
        },
        {
          timePeriod: "15:00",
          schedule: [],
        },
        {
          timePeriod: "16:00",
          schedule: [],
        },
        {
          timePeriod: "17:00",
          schedule: [],
        },
        {
          timePeriod: "18:00",
          schedule: [],
        },
        {
          timePeriod: "19:00",
          schedule: [],
        },
        {
          timePeriod: "20:00",
          schedule: [],
        },
        {
          timePeriod: "21:00",
          schedule: [],
        },
        {
          timePeriod: "22:00",
          schedule: [],
        },
        {
          timePeriod: "23:00",
          schedule: [],
        },
      ],

    };
  },
  components: {
    WSchedule,
    WeekDayTodolist
  },
  beforeCreate() {

  },
  created() {
    /*  let store = userCount();
     console.log(store.todolist); */
    for (let i = 0; i < this.store.todolist.length; i++) {
      let content = this.store.todolist[i].content;
      let date = this.store.todolist[i].startDate.slice(0, 10);
      let timePeriod =
        this.store.todolist[i].startDate.slice(11, 16) +
        "-" +
        this.store.todolist[i].endDate.slice(11, 16);
      let place = this.store.todolist[i].address;
      let status = this.store.todolist[i].status;
      let partner = this.store.todolist[i].partner;
      let id = this.store.todolist[i].id;
      switch (this.store.todolist[i].startDate.slice(11, 13)) {
        case "00":
          console.log(date);
          if (this.timePeriodList[0].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[0].schedule.length; j++) {
              if (this.timePeriodList[0].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[0].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner,
                  id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[0].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[0].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "01":
          console.log(date);
          if (this.timePeriodList[1].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[1].schedule.length; j++) {
              if (this.timePeriodList[1].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[1].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[1].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[1].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "02":
          console.log(date);
          if (this.timePeriodList[2].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[2].schedule.length; j++) {
              if (this.timePeriodList[2].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[2].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[2].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[2].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "03":
          console.log(date);
          if (this.timePeriodList[3].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[3].schedule.length; j++) {
              if (this.timePeriodList[3].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[3].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[3].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[3].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "04":
          console.log(date);
          if (this.timePeriodList[4].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[4].schedule.length; j++) {
              if (this.timePeriodList[4].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[4].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[4].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[4].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner,
                },
              ],
            });
          }
          break;
        case "05":
          console.log(date);
          if (this.timePeriodList[5].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[5].schedule.length; j++) {
              if (this.timePeriodList[5].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[5].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[5].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner,
                      id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[5].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner,
                },
              ],
            });
          }
          break;
        case "06":
          console.log(date);
          if (this.timePeriodList[6].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[6].schedule.length; j++) {
              if (this.timePeriodList[6].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[6].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[6].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[6].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner,
                },
              ],
            });
          }
          break;
        case "07":
          console.log(date);
          if (this.timePeriodList[7].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[7].schedule.length; j++) {
              if (this.timePeriodList[7].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[7].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[7].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[7].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner,
                },
              ],
            });
          }
          break;
        case "08":
          console.log(date);
          if (this.timePeriodList[8].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[8].schedule.length; j++) {
              if (this.timePeriodList[8].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[8].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[8].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[8].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "09":
          console.log(date);
          if (this.timePeriodList[9].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[9].schedule.length; j++) {
              if (this.timePeriodList[9].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[9].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[9].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[9].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner,
                },
              ],
            });
          }
          break;
        case "10":
          console.log(date);
          if (this.timePeriodList[10].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[10].schedule.length;
              j++
            ) {
              if (this.timePeriodList[10].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[10].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[10].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[10].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "11":
          console.log(date);
          if (this.timePeriodList[11].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[11].schedule.length;
              j++
            ) {
              if (this.timePeriodList[11].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[11].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[11].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[11].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "12":
          console.log(date);
          if (this.timePeriodList[12].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[12].schedule.length;
              j++
            ) {
              if (this.timePeriodList[12].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[12].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[12].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[12].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "13":
          console.log(date);
          if (this.timePeriodList[13].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[13].schedule.length;
              j++
            ) {
              if (this.timePeriodList[13].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[13].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[13].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[13].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "14":
          console.log(date);
          if (this.timePeriodList[14].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[14].schedule.length;
              j++
            ) {
              if (this.timePeriodList[14].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[14].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[14].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[14].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "15":
          console.log(date);
          if (this.timePeriodList[15].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[15].schedule.length;
              j++
            ) {
              if (this.timePeriodList[15].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[15].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[15].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[15].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "16":
          console.log(date);
          if (this.timePeriodList[16].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[16].schedule.length;
              j++
            ) {
              console.log(this.timePeriodList[16].schedule.length);
              console.log(this.timePeriodList[16].schedule);
              // console.log(this.timePeriodList[16].schedule[0]["2022-12-18"]);
              // console.log(this.timePeriodList[16].schedule[0][date]);
              console.log(this.timePeriodList[16].schedule[j]);
              if (this.timePeriodList[16].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[16].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[16].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner,
                    },
                  ],
                });
                break;
              }

              // if(this.timePeriodList[16].schedule[j][date].length > 0) {
              //   if(this.timePeriodList[16].schedule[j][date][0].date === date) {}
              // }
              // if (
              //   this.timePeriodList[16].schedule[j][date][0].length > 0 &&
              //   this.timePeriodList[16].schedule[j][date][0].date === date
              // ) {
              //   console.log("有么有");
              //   this.timePeriodList[16].schedule[j][date].push({
              //     content: content,
              //     date: date,
              //     place:place,
              //     status: status,
              //     timePeriod: timePeriod,
              //     watchman: partner ,
              //   });
              // } else {
              //   console.log("ggg");
              //   this.timePeriodList[16].schedule.push({
              //     isExpend: false,
              //     [date]: [
              //       {
              //         content: content,
              //         date: date,
              //         place:place,
              //         status: status,
              //         timePeriod: timePeriod,
              //         watchman: partner ,
              //       },
              //     ],
              //   });
              //   break;
              // }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[16].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "17":
          console.log(date);
          if (this.timePeriodList[17].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[17].schedule.length;
              j++
            ) {
              if (this.timePeriodList[17].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[17].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[17].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[17].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "18":
          console.log(date);
          if (this.timePeriodList[18].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[18].schedule.length;
              j++
            ) {
              if (this.timePeriodList[18].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[18].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[18].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[18].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "19":
          console.log(date);
          if (this.timePeriodList[19].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[19].schedule.length;
              j++
            ) {
              if (this.timePeriodList[19].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[19].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[19].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[19].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "20":
          console.log(date);
          if (this.timePeriodList[20].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[20].schedule.length;
              j++
            ) {
              if (this.timePeriodList[20].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[20].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[20].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[20].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "21":
          console.log(date);
          if (this.timePeriodList[21].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[21].schedule.length;
              j++
            ) {
              if (this.timePeriodList[21].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[21].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[21].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[21].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "22":
          console.log(date);
          if (this.timePeriodList[22].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[22].schedule.length;
              j++
            ) {
              if (this.timePeriodList[22].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[22].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[22].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[22].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
        case "23":
          console.log(date);
          if (this.timePeriodList[23].schedule.length > 0) {
            for (
              let j = 0;
              j < this.timePeriodList[23].schedule.length;
              j++
            ) {
              if (this.timePeriodList[23].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[23].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[23].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[23].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
          console.log(date);
          if (this.timePeriodList[0].schedule.length > 0) {
            for (let j = 0; j < this.timePeriodList[0].schedule.length; j++) {
              if (this.timePeriodList[0].schedule[j].hasOwnProperty(date)) {
                console.log("能不能出来");
                this.timePeriodList[0].schedule[j][date].push({
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                });
              } else {
                console.log("ggg");
                this.timePeriodList[16].schedule.push({
                  isExpend: false,
                  [date]: [
                    {
                      content: content,
                      date: date,
                      place: place,
                      status: status,
                      timePeriod: timePeriod,
                      watchman: partner, id: id
                    },
                  ],
                });
                break;
              }
            }
          } else {
            console.log("hhh");
            this.timePeriodList[0].schedule.push({
              isExpend: false,
              [date]: [
                {
                  content: content,
                  date: date,
                  place: place,
                  status: status,
                  timePeriod: timePeriod,
                  watchman: partner, id: id
                },
              ],
            });
          }
          break;
      }
    }
    console.log(this.timePeriodList[8].schedule[0]);

  },

  methods: {
    /**
     * 点击详情
     * @param row
    */
    handleDetail(row) {
      axios.post('http://8.130.43.203:8080/content/findById2/', { id: row.id }).then(resp => {
        /* 放在外面先我一步 */
        this.store.todoid = row.id
        this.store.todaylist = resp.data
        this.visible = true
        this.store.day = row.date
      })
      console.log(row);
    },
    /**
     * 点击卡片查看全部内容
     */
    handleCardDetail(row) {
      console.log(row);

    },
    /**
     * 切换周
     * @param date
     */
    changeWeek(date) {
      console.log(date);
    },
  },
};
</script>
